package cn.easy.mapper;


import cn.easy.common.pojo.DataViewPojo;
import cn.easy.pojo.Data;
import cn.easy.pojo.DataExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface DataMapper {
    int countByExample(DataExample example);

    int deleteByExample(DataExample example);

    int deleteByPrimaryKey(Integer dataId);

    int insert(Data record);

    int insertSelective(Data record);

    List<Data> selectByExample(DataExample example);

    Data selectByPrimaryKey(Integer dataId);

    int updateByExampleSelective(@Param("record") Data record, @Param("example") DataExample example);

    int updateByExample(@Param("record") Data record, @Param("example") DataExample example);

    int updateByPrimaryKeySelective(Data record);

    int updateByPrimaryKey(Data record);

    List<DataViewPojo> selectDataWithTime(@Param("sensorId") Integer sensorId, @Param("startTime") String startTime, @Param("endTime") String endTime);
    //获取某个传感器上传的最新数据
    Data selectNewData(int sensorId);
}